//
//  KZBaseAvatarImageView.m
//  kangzhipifuyisheng
//
//  Created by 唐开江 on 15/5/28.
//  Copyright (c) 2015年 KangZhi. All rights reserved.
// 

#import "KZBaseAvatarImageView.h"
#import "UIColor+hexColor.h"
#import "UIImageView+WebCache.h"

@interface KZBaseAvatarImageView ()

@end

@implementation KZBaseAvatarImageView


- (void)awakeFromNib
{
    [super awakeFromNib];
    
    
    [self setAttibute];
}


- (void)setimageWithUrlStr:(NSString *)urlStr
{

    
    NSURL * url = [NSURL URLWithString:urlStr];
    [self sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"doctor_avatar"]];
    

}



- (instancetype)initWithFrame:(CGRect)frame

{
    if (self = [super initWithFrame:frame]) {
        [self setAttibute];
        
    }
    return self;
}


- (void)setAttibute
{
    self.layer.cornerRadius = self.width*0.5;
    self.layer.masksToBounds = YES;
//    self.backgroundColor = [UIColor hexFloatColor:@"D4D4D4"];
//    UIImage * placeHolder = [UIImage imageNamed:@""];
//    self.image = placeHolder;

    [self setImage:[UIImage imageNamed:@"special_avatar"]];
    
}

+ (instancetype)addAvatarImageView
{
 return   [[[NSBundle mainBundle]loadNibNamed:@"KZBaseAvatarImageView" owner:nil options:nil]firstObject];
}

@end
